#ifndef CHECK_H
#define CHECK_H
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <syslog.h>

//error日志类型
#define ERRNO_LOGGING(ret, errno, msg)\
    do {\
        if (ret == errno) {\
            syslog(LOG_ERR, "file:%s ,function:%s, line:%d, error:%s\n", __FILE__, __FUNCTION__, __LINE__, msg);\
        }\
    }while(0)

//wring日志类型
#define WARNING_LOGGING(ret, warning, msg)\
    do {\
        if (ret == warning) {\
            syslog(LOG_WARNING, "file:%s ,function:%s, line:%d, warning:%s\n", __FILE__, __FUNCTION__, __LINE__, msg);\
        }\
    }while(0)
//info日志类型
#define INFO_LOGGING(msg)\
    do {\
            syslog(LOG_INFO, "file:%s ,function:%s, line:%d, warning:%s\n", __FILE__, __FUNCTION__, __LINE__, msg);\
    }while(0)
#endif
